package com.zc.listener;

import java.util.List;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.context.support.WebApplicationContextUtils;

import com.zc.domain.DoubleListData;
import com.zc.domain.Item;
import com.zc.domain.TimedTaskThread;
//import com.zc.service.DataService;
import com.zc.service.FaultService;
import com.zc.service.PowerFactorService;
import com.zc.service.PowerService;
import com.zc.service.PresService;
import com.zc.service.TcService;
import com.zc.service.TemService;
import com.zc.service.RedisService;
//import com.zc.service.impl.DataServiceImpl;
import com.zc.service.impl.FaultServiceImpl;
import com.zc.service.impl.PowerFactorServiceImpl;
import com.zc.service.impl.PowerServiceImpl;
import com.zc.service.impl.PresServiceImpl;
import com.zc.service.impl.TcServiceImpl;
import com.zc.service.impl.TemServiceImpl;
import com.zc.service.impl.RedisServiceImpl;

@Component
public class ProjBeginListener implements ServletContextListener{
	@Override
	public void contextInitialized(ServletContextEvent sce) {
		TimedTaskThread timedTaskThread=WebApplicationContextUtils.getWebApplicationContext(sce.getServletContext()).getBean(TimedTaskThread.class);	
		new Thread(timedTaskThread).start();
	}

	@Override
	public void contextDestroyed(ServletContextEvent sce) {}
}
